<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        function foo(x = 5) {
            let x = 1; // error 参数变量是默认声明的，所以不能用let或const再次声明
            const x = 2; // error
        }
    </script>
</body>

</html>